#-------------------------------------------------------------------
# This file is part of the CMake build system for ogre-url
#-------------------------------------------------------------------

project (OgreURLDemo)

# define header files for the library
set (HEADER_FILES
	include/OgreURLDemo.h
	include/OgreURLDemoPrecompiledHeader.h
)

# define source files for the library
set (SOURCE_FILES
	src/main.cpp
	src/OgreURLDemo.cpp
)

# setup precompiled header file, msvc only for now
if (SETUP_ENABLE_PRECOMPILED_HEADERS AND MSVC)
	list (APPEND SOURCE_FILES src/OgreURLDemoPrecompiledHeader.cpp)
	add_definitions (/YuOgreURLDemoPrecompiledHeader.h -DOGREURL_ENABLE_PRECOMPILED_HEADERS)
	set_source_files_properties (src/OgreURLDemoPrecompiledHeader.cpp PPROPERTIES COMPILE_FLAGS /YcOgreURLDemoPrecompiledHeader.h)
endif (SETUP_ENABLE_PRECOMPILED_HEADERS AND MSVC)

# setup project include directory
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)

# build folder
include_directories (${CMAKE_BINARY_DIR}/include/)

# setup dependency directories 
include_directories (${CMAKE_HOME_DIRECTORY}/OgreURL/include)
# boost
if (BOOST_IS_REQUIRED)
	include_directories (${Boost_INCLUDE_DIRS})
endif (BOOST_IS_REQUIRED)
# ogre
include_directories (${OGRE_INCLUDE_DIRS})
include_directories (${OGRE_CONFIG_INCLUDE_DIRS})

# setup link directories 
# boost
if (BOOST_IS_REQUIRED)
	link_directories (${Boost_LIBRARY_DIRS})
endif (BOOST_IS_REQUIRED)
# setup OgreURLDemo target
add_executable (OgreURLDemo WIN32 ${HEADER_FILES} ${SOURCE_FILES})

# setup link libraries
target_link_libraries (OgreURLDemo OgreURL ${OGRE_LIBRARIES})
# boost
if (BOOST_IS_REQUIRED)
	target_link_libraries (OgreURLDemo ${Boost_THREAD_LIBRARY} ${Boost_DATE_TIME_LIBRARY})
endif (BOOST_IS_REQUIRED)

# setup project dependencies
add_dependencies(OgreURLDemo OgreURL)

# create vcproj.user file for Visual Studio
if (MSVC)
	message (STATUS "Creating OgreURLDemo.vcproj.user...")
	configure_file (${CMAKE_HOME_DIRECTORY}/CMake/Templates/VisualStudioUserFile.vcproj.user.in 
		${CMAKE_CURRENT_BINARY_DIR}/OgreURLDemo.vcproj.user 
		COPYONLY
	)
endif (MSVC)
